<template>
  <van-form>
    <van-field
      v-model="appoint.feedback"
      rows="1"
      autosize
      label="异常反馈"
      type="textarea"
      placeholder="请输入信息"
      maxlength="300"
      show-word-limit
    />
    <van-button @click="back()">提交反馈</van-button>
  </van-form>
</template>

<script>
import appointment from '@/api/appointment'
import { Toast } from 'vant'
export default {
  name: 'Back',
  data() {
    return {
      appoint: {
        feedback: '',
        id: ''
      }

    }
  },
  created() {
    if (this.$route.params.id) {
      this.appoint.id = this.$route.params.id
    }
  },
  methods: {
    back() {
      appointment.back(this.appoint).then(response => {
        this.$router.push({ path: '/' })
        Toast.success('反馈成功')
      })
    }
  }
}
</script>

<style scoped>

</style>
